package com.example.lizhanqi.livevideo.model.net;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bigkoo.convenientbanner.holder.Holder;
import com.bumptech.glide.Glide;
import com.example.lizhanqi.livevideo.R;
import com.example.lizhanqi.livevideo.bean.HotBean;

/**
 * Created by Lizhanqi on 2016/9/17 0017.
 */
public class NetworkImageHolderView implements Holder<HotBean.ContentBean.BannerBean> {
    private ImageView imageView;
    @Override
    public View createView(Context context) {
        //你可以通过layout文件来创建，也可以像我一样用代码创建，不一定是Image，任何控件都可以进行翻页
        imageView = new ImageView(context);
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        return imageView;
    }
    @Override
    public void UpdateUI(Context context,int position, HotBean.ContentBean.BannerBean data) {
        Glide.with(context).load(data.getImg()).error(R.drawable.li_bg_attention_list_empty).placeholder(R.drawable.li_bg_attention_list_empty).into(imageView);
    }
}